package com.xu.a2019;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

public class LanuchActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_lanucher);
        ImageView back = findViewById(R.id.iv_launch);
        long a = System.currentTimeMillis();
        if (a % 3 == 0) {
            back.setImageResource(R.mipmap.timg1);
        } else if (a % 3 == 1) {
            back.setImageResource(R.mipmap.timg2);
        } else {
            back.setImageResource(R.mipmap.timg3);
        }
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                startActivity(new Intent(LanuchActivity.this, MainActivity.class));
                overridePendingTransition(R.anim.fade_0_to_1, R.anim.fade_1_to_0);
                finish();
            }
        }, 500);
    }
}
